package com.synjones.zeus.model.ykt.userinfo;

/**
 * 性别枚举
 *
 */
public enum UserState {
    _0("0", "男"),
    _1("1", "女"),
    _2("2","未知"),
    _3("female","女"),
    _4("male","男"),
    _5("unknown","未知");

    /**状态码*/
    private final String code;
    /**状态码描述*/
    private final String desc;

    UserState(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    /**
     * 根据code获取描述
     * @param code
     * @return
     */
    public static String getDesc(String code) {
        for (UserState info : UserState.values()) {
            if (code.equals(info.code)) {
                return info.desc;
            }
        }
        return null;
    }
}
